package GameEngine;

/**
 * Location class is belong to boat class.
 */
public class Location
{
	private int x;
	private int y;
	
	
	public Location(int a,int b)
	{
		this.x = a;
		this.y = b;
	}
	/**
	 * Sets the location of the boats
	 * x coordinate will be between 90 and 560
	 * y coordinate will be between 0 and 400
	 * 
	 * @param a is the x coordinate of the boat
	 * @param b is the y coordinate of the boat
	 * 
	 */
	public void setLocation(int a,int b)
	{
		if (a<90){
			this.x = 100;
			Main.Main.mygame.getBoat().damaged();
		}
		else
			if (a>560){
				this.x = 550;
				Main.Main.mygame.getBoat().damaged();
			}
			else
				this.x = a;
		if (b<0)
			this.y = 0;
		else
			if (b>400)
				this.y = 400;
			else
				this.y = b;
	}

	public int getX() {
		return x;
	}

	public void setX(int x) {
		this.x = x;
	}

	public int getY() {
		return y;
	}

	public void setY(int y) {
		this.y = y;
	}
	
}